home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / tlxjwpc5.zip / RBBSN4.SLT < prev    next >
Text File  |  1990-12-31  |  8KB  |  253 lines

  1. //╔═════════════════════════════════════════════════════════════════════╗
  2. //║ RBBS 17.3B         JW-PC Consulting DataFlex.HST      (608)837-1923 ║
  3. //║ Dual Std HST/V.32/MNP5/V.42     RBBSnet 8:972/2     FIDOnet 1:121/8 ║
  4. //╚═════════════════════════════════════════════════════════════════════╝
  5. // RBBSN4.SLT  by Jim Wargula, Sysop of JW-PC DataFlex.HST, 12-21-90.
  6. // This is a sample TELIX script for logging on to JW-PC DataFlex.HST.
  7. // It will log in, download SMLNET sequence list new messages, and start
  8. // to read main base messages.  The name of the bbs will show on the
  9. // status line.
  10.  
  11. str user_name[30] = "joe schmoe ";
  12.  
  13. // Put your name in the above line. The script will get the proper password
  14. // from the dialing directory (Telix puts that password in the script system
  15. // variable called _entry_pass).  Use spaces as in example!
  16. // Before using this script for the first time, or when you make a change,
  17. // type 'cs rbbsn3' at the DOS prompt to compile the script for use by Telix.
  18.  
  19. //////////////////////////////////////////////////////////////////////////////
  20. //  globals
  21. //
  22.  
  23. // used by showname():
  24. //
  25. int       statline =  24;                     // Telix status line row
  26. int       statback =   7;                     // status line background color
  27. int       statfore =   0;                     // status line foreground color
  28.  
  29. str       failed[] = "Logon failed.";
  30.  
  31. // DSZ stuff
  32. str dsz[84]  =
  33.   "c:\util\DSZ port ";
  34.  
  35. str upld[32]  =
  36.   " pW1 pB4096 ha cts sz -b -m -r ";
  37.  
  38. str dnld[32]=
  39.   " pW1 pB4096 ha cts rz -b -m -rr ";
  40.  
  41. str port[1];
  42.  
  43. //////////////////////////////////////////////////////////////////////////////
  44. //  main routine
  45. //
  46. main()
  47. {
  48.  int stat;
  49.  
  50.  int t1, t2, t3, t4, t5, t6, t7, t8, t9;
  51.  
  52.  int tmark;
  53.  
  54.  alarm(1);                              // connect!
  55.  itos(get_port(),port);
  56.  showname();
  57.  
  58.  if (not _entry_pass)                   // no pass, so didn't recog. board
  59.   {
  60.    prints ("Sorry, I don't know the password for this BBS!");
  61.    return;
  62.   }
  63.  strcat (user_name, _entry_pass);       // build name for turbo login
  64.  strcat (user_name, " !");
  65.  
  66.  t1 = track ("ontinue", 1);            // define tracks
  67.  t2 = track ("First name?", 1);
  68.  t3 = track (" ([Y],N", 1);
  69.  t4 = track (">? ", 1);
  70.  t5 = track (", Enter ", 1);
  71.  t6 = track (" : ", 1);
  72.  t7 = track ("Countdown =", 1);
  73.  t8 = track ("**", 1);
  74.  t9 = track ("More [Y", 1);
  75.  
  76.  delay_scr (80);                        // wait 8 seconds for front end
  77.  cputs ("^[");                          // send escape to wake bbs up!
  78.  
  79.  tmark = timer_start (6000);            // wait up to 10 minutes for login Part I
  80.  
  81. //////////////////////////////////////////////////////////////////////////////
  82. //  Loop I - Login, open NET door, extract messages.
  83. //
  84.  
  85.  while (not time_up (tmark))
  86.   {
  87.    terminal();                          // let Telix process any chars and keys
  88.  
  89.    stat = track_hit (0);                // see which (if any) track was hit
  90.  
  91.    if (stat == t1)                      // respond to Key to continue
  92.     {
  93.      delay (1);
  94.      cputs ("^M");
  95.     }
  96.    else if (stat == t2)                 // send name and password
  97.     {
  98.      cputs (user_name);
  99.      cputs ("^M");
  100.     }
  101.    else if (stat == t3)                 // send "NO"
  102.     {
  103.      cputs ("n^M");
  104.     }
  105.    else if (stat == t9)                 // send "NO"
  106.     {
  107.      delay (1);
  108.      cputs ("n^M");
  109.     }
  110.  
  111.               ////////////////////////// comment out or delete section of code
  112.               ////////////////////////// between these and comment bars below
  113.               ////////////////////////// for standard login - no netmail called
  114.  
  115.    else if (stat == t4)                 // main menu...
  116.     {
  117.      delay (1);
  118.      cputs ("d xpress^M");                 //open Net Door
  119.     }
  120.    else if (stat == t5)                 //net conference menu...
  121.     {
  122.      delay (1);
  123.      cputs ("d^M");                     //scan/download messages
  124.      break;                             //goto next section tracking
  125.     }
  126.   }
  127.  
  128.  if (time_up (tmark))
  129.     {
  130.     prints ("Part I failed!");
  131.     return;
  132.     }
  133.  
  134.  timer_free (tmark);                    // free timer channel
  135.  
  136.  tmark = timer_start (12000);           // wait up to 20 minutes for login Part II
  137.  
  138. //////////////////////////////////////////////////////////////////////////////
  139. //  Loop II -  Download extract file
  140. //
  141.  strcat(dsz,port);
  142.  strcat(dsz,dnld);
  143.  strcat(dsz,_down_dir);                 //using ZmodemMobyturbo
  144.  
  145.  while (not time_up (tmark))
  146.   {
  147.    terminal();                          // let Telix process any chars and keys
  148.  
  149.    stat = track_hit (0);                // see which (if any) track was hit
  150.  
  151.    if (stat == t6)                      //pack extract
  152.     {
  153.      delay (1);
  154.      cputs ("a^M");
  155.     }
  156.  
  157.    else if (stat == t7)                      // respond to continue
  158.     {
  159.      cputs ("^M");
  160.     }
  161.    else if (stat == t8)                 // call zmodem
  162.     {
  163.      dos(dsz,0);
  164.      break;                             //goto next section tracking
  165.     }
  166.  }
  167.  if (time_up (tmark))
  168.     {
  169.     prints ("Part II failed!");
  170.     return;
  171.     }
  172.  
  173.  timer_free (tmark);                    // free timer channel
  174.  
  175.  tmark = timer_start (1800);           // wait up to 3 minutes for login Part III
  176.  
  177. //////////////////////////////////////////////////////////////////////////////
  178. //  Loop III - Exit Xpress door, read messages
  179. //
  180.  
  181.  while (not time_up (tmark))
  182.   {
  183.    terminal();                          // let Telix process any chars and keys
  184.  
  185.    stat = track_hit (0);                // see which (if any) track was hit
  186.  
  187.    if (stat == t5)                      // good-bye to Xpress door
  188.     {
  189.      delay (1);
  190.      cputs ("q^M");
  191.     }
  192.  
  193.               ////////////////////////// comment out or delete section of code
  194.               ////////////////////////// between these and comment bars above
  195.               ////////////////////////// for standard login - no netmail called
  196.  
  197.    else if (stat == t4)                 // main menu back
  198.     {
  199.      cputs ("r s^M");
  200.      break;                             // read msgs & done
  201.     }
  202.   }
  203.  
  204. //////////////////////////////////////////////////////////////////////////////
  205. //  End  - Clean-up
  206. //
  207.  
  208.  if (time_up (tmark))
  209.     {
  210.     prints ("Part III failed!");
  211.     return;
  212.     }
  213.  
  214.  timer_free (tmark);                    // free timer channel
  215.  track_free (0);                        // and all track channels
  216.  alarm (5);                             // sound alarm, we're there!
  217. }
  218.  
  219. //////////////////////////////////////////////////////////////////////////////
  220. //  Function:     showname
  221. //  Description:  Displays the name of the system you're connected to, or
  222. //                "Alt-Z for Help" if you're not connected to anything.
  223. //
  224. //                You can plug this into ANY logon script file, just call it
  225. //                as shown in main().
  226. //
  227. //                This routine will overwrite the "Alt-Z for Help" message,
  228. //                but I think it's worth it.  If you don't like this feature,
  229. //                set the Anonymous option in SLCONFIG to 'y' (YES).
  230. //  Parameters:   none
  231. //  Returns:      nothing
  232. //
  233. showname()
  234. {
  235.   str       name[14];                         // name to display
  236.   int       x, y;                             // old cursor position
  237.  
  238.   x = getx();                                 // save current position
  239.   y = gety();                                 //
  240.  
  241.   substr(_entry_name, 0, 14, name);           // get the current BBS name
  242.   if ((strlen(name) == 0) || (! carrier()))   // no name or not connected?
  243.     name = "Alt-Z for Help";                  //   then display help message
  244.  
  245.   strcat(name, "              ");             // pad name with spaces
  246.  
  247.   pstraxy( name, 1, statline,                 // display it
  248.            (statback * 16) + statfore
  249.          );
  250.  
  251.   gotoxy(x, y);                               // return to saved position
  252. }
  253.